#include <bits/stdc++.h>
// 2025/07/20
// tag: 
// Author: Forever
using namespace std;
using int64 = int64_t;
#define int long long

int n;
struct node{
    int x, y;
} point[400005], p[400005];

bool cmp(node a, node b){
    return a.x < b.x;
}

bool cmp2(node a, node b){
    return a.y < b.y;
}

int dis(node a, node b){
    return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}

int merge(int l, int r){
    if (l == r)
        return 1e18;
    if (l + 1 == r)
        return dis(point[l], point[r]);
    int mid = (l + r) >> 1;
    int d = min(merge(l, mid), merge(mid + 1, r));
    int cnt = 0;
    for (int i = l; i <= r; i++) {
        if ((point[i].x - point[mid].x) * (point[i].x - point[mid].x) <= d)
            p[++cnt] = point[i];
    }
    sort(p + 1, p + cnt + 1, cmp2);
    for (int i = 1; i <= cnt; i++){
        for (int j = i + 1; j <= cnt; j++){
            if ((p[j].y - p[i].y) * (p[j].y - p[i].y) >= d)
                break;
            d = min(d, dis(p[i], p[j]));
        }
    }
    return d;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> point[i].x >> point[i].y;
    sort(point + 1, point + n + 1, cmp);
    cout << fixed << setprecision(4) << sqrt(merge(1, n)) << endl;
    return 0;
}